package com.example.validated.vo;


import com.example.validated.annotation.EnumValue;
import com.example.validated.annotation.TestValidGroup;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.Valid;
import javax.validation.constraints.*;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ProjectDTO {

    @NotBlank(message = "ID不能为空", groups = {TestValidGroup.Update.class})
    private String id;

    @NotBlank
    @Pattern(regexp = "[a-zA-Z0-9]", message = "只允许输入数字和字母")
    private String strValue;

    @Min(value = -99, message = "值不能小于-99")
    @Max(value = 100, message = "值不能超过100")
    private Integer intValue;

    @Negative(message = "值必须为负数")
    private Integer negativeValue;

    @EnumValue(strValues = {"agree", "refuse"})
    private String strEnum;

    @EnumValue(intValues = {1983, 1990, 2022})
    private Integer intEnum;


//    @Valid
//    private TeamDTO teamDTO;

}
